Home:ALL Converter>Get stuck when installing MySQL 8 on Ubuntu

Get stuck when installing MySQL 8 on Ubuntu

Ask Time:2022-03-02T03:09:10         Author:James Chan

Json Formatter

I am installing MySQL8.0 on Ubuntu20.04, I updated apt before installing. Then I use the following command:

sudo apt install mysql-server

It says "Unable to start the server":

Warning: Unable to start the server.
Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service.
Job for mysql.service failed because a fatal signal was delivered to the control process.
See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: signal) since Tue 2022-03-01 18:47:38 UTC; 119ms ago
    Process: 46667 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 46685 ExecStart=/usr/sbin/mysqld (code=killed, signal=KILL)
   Main PID: 46685 (code=killed, signal=KILL)
     Status: "Server startup in progress"
    dpkg: error processing package mysql-server-8.0 (--configure):
     installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
    dpkg: dependency problems prevent configuration of mysql-server:
     mysql-server depends on mysql-server-8.0; however:
      Package mysql-server-8.0 is not configured yet.
dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Processing triggers for systemd (245.4-4ubuntu3.15) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.7) ...
Errors were encountered while processing:
 mysql-server-8.0
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

MySQL is installed but I don't think it's successful. So I try to start the server:

sudo service mysql start

It returns:

Job for mysql.service failed because a fatal signal was delivered to the control process.
See "systemctl status mysql.service" and "journalctl -xe" for details.

"systemctl status mysql.service" shows:

● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: failed (Result: signal) since Tue 2022-03-01 19:00:36 UTC; 1min 52s ago
    Process: 47280 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 47288 ExecStart=/usr/sbin/mysqld (code=killed, signal=KILL)
   Main PID: 47288 (code=killed, signal=KILL)
     Status: "Server startup in progress"

Mar 01 19:00:35 ip-172-26-2-194 systemd[1]: mysql.service: Main process exited, code=killed, status=9/KILL
Mar 01 19:00:35 ip-172-26-2-194 systemd[1]: mysql.service: Failed with result 'signal'.
Mar 01 19:00:35 ip-172-26-2-194 systemd[1]: Failed to start MySQL Community Server.
Mar 01 19:00:36 ip-172-26-2-194 systemd[1]: mysql.service: Scheduled restart job, restart counter is at 15.
Mar 01 19:00:36 ip-172-26-2-194 systemd[1]: Stopped MySQL Community Server.
Mar 01 19:00:36 ip-172-26-2-194 systemd[1]: mysql.service: Start request repeated too quickly.
Mar 01 19:00:36 ip-172-26-2-194 systemd[1]: mysql.service: Failed with result 'signal'.
Mar 01 19:00:36 ip-172-26-2-194 systemd[1]: Failed to start MySQL Community Server.

"journalctl -xe" shows:

-- Automatic restarting of the unit mysql.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Mar 01 19:00:36 ip-172-26-2-194 systemd[1]: Stopped MySQL Community Server.
-- Subject: A stop job for unit mysql.service has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A stop job for unit mysql.service has finished.
-- 
-- The job identifier is 33416 and the job result is done.
Mar 01 19:00:36 ip-172-26-2-194 systemd[1]: mysql.service: Start request repeated too quickly.
Mar 01 19:00:36 ip-172-26-2-194 systemd[1]: mysql.service: Failed with result 'signal'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit mysql.service has entered the 'failed' state with result 'signal'.
Mar 01 19:00:36 ip-172-26-2-194 systemd[1]: Failed to start MySQL Community Server.
-- Subject: A start job for unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit mysql.service has finished with a failure.
-- 
-- The job identifier is 33416 and the job result is failed.
Mar 01 19:03:07 ip-172-26-2-194 sshd[47296]: error: kex_exchange_identification: Connection closed by remote host

I am not really understand what is "Failed with result 'signal'" and don't know what to do next. (I have tried purging and reinstalling, it doesn't work)

It's an Amazon Lightsail cloud server, which only has 512MB memory. I use "free" command and it shows that 176MB memory is available.

Author:James Chan,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/71313478/get-stuck-when-installing-mysql-8-on-ubuntu
yy